import React from 'react';
import ReactDOM from 'react-dom';
import {IntervalEnhance} from './IntervalEnhance';
import {CartTimeoutEnhance} from './CartTimeoutEnhance';
import ModalAlertTimeout from './ModalAlertTimeout';


class InputExample extends React.Component {

	constructor(props){
		super(props);
		this.state={
			name:'-'
		};
		this.handlerOnChange=this.handlerOnChange.bind(this);

		this.alertTimeout =this.alertTimeout.bind(this);
	}
	render(){
		return (<div><input className="form-control" type="text"   
			 value={this.state.name} 
			 onChange={this.handlerOnChange}/>
			 	<h3>seconds:{this.props.cartTimeout}</h3>
			 </div>)
	}
	handlerOnChange(event){
		this.setState({name:event.target.value.toUpperCase()})

	}
	
	alertTimeout(){
		React.render(<ModalAlertTimeout />, document.getElementById('modalAlertTimeout'));
		//this.setState({currentStep: 1, formValues: {}, cartTimeout: 1});

	}
}

export default CartTimeoutEnhance(InputExample)